-- card: 3600 from stack: in -- bmap block id: 2320 -- flags: 0000 -- background id: 2620 -- name: -- part 1 (button) -- low flags: 00 -- high flags: A002 -- rect: left=434 top=274 right=298 bottom=509 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Aggiorna ----- HyperTalk script ----- on mouseUp put the userLevel into saveLevel if the userLevel < 3 then set userLevel to 3 -- "Disegno" if the userLevel < 3 then exit mouseUp put frameBottom()-frameHeight()+10 into pieTop put frameLeft()+5 into pieLeft put frameHeight()-20 into pieDiameter clearScreen reset paint choose oval tool set lineSize to 2 set dragSpeed to 0 drag from pieLeft,pieTop to pieLeft+pieDiameter, pieTop+pieDiameter set centered to false put the number of lines in field "Dati" into dataCount put zero into total repeat with i = 1 to dataCount add line i of field "Dati" to total end repeat put "Il totale è" && total into background field "Totale" put pieDiameter div 2 into pieRadius put pieLeft+pieRadius into pieCenterX put pieTop+pieRadius into pieCenterY choose line tool put zero into angle put zero into change repeat with i = 1 to dataCount+1 put pieCenterX + round(pieRadius * sin(angle)) into x put pieCenterY - round(pieRadius * cos(angle)) into y choose line tool drag from pieCenterX,pieCenterY to x,y if change > .02 then set pattern to getPattern(i) choose bucket tool click at halfX, halfY end if get line i of field "dati" put pi * it / total into change add change to angle put pieCenterX + round((pieRadius-3) * sin(angle)) into halfX put pieCenterY - round((pieRadius-3) * cos(angle)) into halfY add change to angle end repeat reset paint choose browse tool set userLevel to saveLevel end mouseUp function getPattern selector return item (selector mod 12)+1 of "2,13,11,3,14,6,21,17,31,18,4,32" end getPattern -- part contents for background part 5 ----- text ----- 50 26 14 77 36 -- part contents for background part 9 ----- text ----- Il totale è 203 -- part contents for background part 11 ----- text ----- MegaCorp: Ricavi per prodotto